package start;

import java.util.Scanner;

public class T704 {
    public static int fun1(int [] nums,int target){
        int left=0;
        int right=nums.length-1;
        int mod;
        while(left<=right){
            mod=left + ((right - left) >> 1);
            if(nums[mod]>target){
                right=mod-1;
            }else if(nums[mod]<target){
                left=mod+1;
            }else {
                return mod;
            }
        }
        return -1;

    }
    public static void print(int []nums){
        String str="[";
        for (int i=0;i<nums.length;i++){
            str+=nums[i];
            if(i==nums.length-1){
                str+="]";
            }else{
                str+=",";
            }
        }
        System.out.println(str);
    }
    public static int [] shuru(int n){
        int [] nums =new int[n];
        Scanner scanner=new Scanner(System.in);
        for(int i=0;i<n;i++){
            if(scanner.hasNextInt()){
                nums[i]=scanner.nextInt();
            }
        }
        return nums;
    }

    public static void main(String[] args) {
        int []nums=shuru(5);
        print(nums);
        int a=fun1(nums,5);
        System.out.println(a);
    }
}
